import android.cs2340UDT.*;

import org.junit.Test;

import static org.junit.Assert.*;

public class CheckAccountEntriesTest {
	Security security = new Security();
	@Test
	public void test() {
		// completely valid entry
		assertTrue("Valid Entries", security.checkAccountEntries("Bob", "The Bomb", "explosive", "explosive", "Not Checked", "06152011") );
		// passwords do not match
		assertTrue("Password and Confirmation Password Conflict", !security.checkAccountEntries("Bob", "The Bomb", "explosive", "typo", "Not Checked", "06152011") );
		
		// add a user with username "The Bomb"
		security.createUser("Dude", "The Bomb", "", "", "");
		
		// check that account entry information with username "The Bomb" conflicts
		assertTrue("Attempt to add existing user fails", !security.checkAccountEntries("Dude", "The Bomb", "explosive", "explosive", "Not Checked", "06152011") );
		
		// check that entry info with the same username and password fails
		assertTrue("Password and Username Conflict", !security.checkAccountEntries("BadIdea", "The Bomb", "BadIdea", "BadIdea", "Not Checked", "06152011") );
		
		// check that entry info with invalid date fails
		assertTrue("Invalid Date", !security.checkAccountEntries("Bob", "The Bomb", "explosive", "explosive", "Not Checked", "99999999") );
		
		// fail("Not yet implemented");
	}

}
